-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gml 1809 feedback analysis access control #256
Conversation
luzhoutg
commented
Jul 31, 2024
•
edited
Loading
edited
- update feedback analytics notebook with get_feedback endpoint
- add access control
- add test cases
- update the loadConfig to load multiple config files
chat-history/routes/routes.go
Outdated
if tgcloud { | ||
requestURL = fmt.Sprintf("%s:443/gsqlserver/gsql/file", host) | ||
} else { | ||
requestURL = fmt.Sprintf("%s:14240/gsqlserver/gsql/file", host) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For on-prem DBs, the port is not always 14240. Could we read it from config? How are we handling it for copilot?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing this out. Just push the updated. For CoPilot, pyTG have handled it already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Tests could do with a negative test (i.e. user is only allowed to see their messages, not all)
- One quirk in LoadConfig
Otherwise, looks good!
chat-history/config/config.go
Outdated
b, err = os.ReadFile(path) | ||
if err != nil { | ||
|
||
if err := json.Unmarshal(b, &cfg); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're reading multiple config files, won't cfg just be the last file that was parsed in the list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. I update the loadConfig to load multiple config file in to different config structs. i.e., ChatDbConfig, and TgDbConfig. It looks like this: router.HandleFunc("GET /get_feedback", routes.GetFeedback(cfg.TgDbConfig.Hostname, cfg.TgDbConfig.GsPort, cfg.ChatDbConfig.ConversationAccessRoles, cfg.TgDbConfig.TgCloud))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also added test cases for non-admin users and non-existent users.